import cv2 


def main():
	stream_path = 0
	cap = cv2.VideoCapture(stream_path)
	# get fps
	fps = cap.get(cv2.CAP_PROP_FPS)

	while cap.isOpened():
	    ret, frame = cap.read()
	    if not ret:
	        print("Can't receive frame (stream end?). Exiting ...")
	        break
	    frame = cv2.resize(frame, (1080, 720))
	    wait_time = int(1000/fps)
	    cv2.imshow("video", frame)
	    if cv2.waitKey(wait_time) == ord('q'):
	        break

	    cv2.video


if __name__ == '__main__':
	main()